﻿using DirectSell.Model.Money;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Webdiyer.WebControls.Mvc;

namespace Direct.IDAL.User.Money
{
    /// <summary>
    /// 现金币数据接口
    /// </summary>
    public interface IRealMoneyRepository:IAbsRepository
    {
        /// <summary>
        /// 申请现金币
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        void Apply(RealMoneyReq req, ref Hashtable hsTable);
        /// <summary>
        /// 查询申请记录
        /// </summary>
        /// <param name="usercode"></param>
        /// <returns></returns>
        Task<PagedList<RealMoney>> Record(string usercode, int pageindex, int pagesize);
        /// <summary>
        /// 查询余额
        /// </summary>
        /// <param name="usercode"></param>
        /// <returns></returns>
        decimal QueryBalance(string usercode);
        /// <summary>
        /// 计算实际到账金额
        /// </summary>
        /// <param name="money"></param>
        /// <returns></returns>
        Task<decimal> Compute(decimal money);
        /// <summary>
        /// 查询手续费
        /// </summary>
        /// <returns></returns>
        Task<decimal> QueryServiceCharge();
        /// <summary>
        /// 写入消费表
        /// </summary>
        /// <param name="req"></param>
        /// <returns></returns>
        void InsertConsumption(RealMoneyReq req, ref Hashtable hstable);
        /// <summary>
        /// 扣费
        /// </summary>
        /// <param name="req"></param>
        /// <param name="hstable"></param>
        void Deductions(RealMoneyReq req, ref Hashtable hstable);

    }
}
